route simplifier crashed if simplifying by error on routes that couldn't be simplifie...
authorparkrrrr <parkrrrr>
Thu, 26 Jul 2007 01:14:13 +0000 (01:14 +0000)
committerparkrrrr <parkrrrr>
Thu, 26 Jul 2007 01:14:13 +0000 (01:14 +0000)
smplrout.c

index ec370aaa6a007db54870a7d46791e96c0e15a0b8..a7bdd2edbcd73980a3f644ebad099527842ae36c 100644 (file)
@@ -195,6 +195,9 @@ routesimple_head( const route_head *rte )
        /* short-circuit if we already have fewer than the max points */
        if ( countopt && count >= rte->rte_waypt_ct) return;
        
+       /* short-circuit if the route is impossible to simplify, too. */
+       if ( 2 >= rte->rte_waypt_ct ) return;
+       
        xte_recs = (struct xte *) xcalloc(  rte->rte_waypt_ct, sizeof (struct xte));
        cur_rte = rte;